/*
 * @Description: 生长记录管理
 */
import axios from "@/api/axios";
export default {
  queryByNo(no) {
    return axios.get(`/v3/growth/growthProcessRecord/queryByNo?no=${no}`);
  },
  growthProcessRecordPests(no) {
    return axios.get(`/v3/growth/growthProcessRecordPests/queryByNo?no=${no}`);
  },
  growthProcessPicture(no) {
    return axios.get(`/v3/growth/growthProcessPicture/queryByNo?no=${no}`);
  },

  /**
   * @description: 获取生长记录管理 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getlist(params) {
    return axios.post("/v3/growth/growthProcessRecord/queryPageByCondition", {
      ...params
      // order: 'asc',
      // auditFlag: 1,
    });
  },
  /**
   * @description:模糊查询生长记录管理表格列表 *代表必填
   */
  getqueryList(params) {
    return axios.post("/v3/growth/growthProcessRecord/queryByCondition", {
      ...params,
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo")
    });
  },
  /**
   * @description: 批量添加生长记录管理
   * @param {Object}  *
   */
  addlist(params) {
    return axios.post('/v3/growth/growthProcessRecord/add', {
      ...params,
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      organizationNo: sessionStorage.getItem("organizationNo")
    });
  },
  /**
   * @description: 批量删除生长记录管理
   * @param {Object}  *
   */
  dellist(params) {
    return axios.get(`/v3/growth/growthProcessRecord/delListByNo?noList=${params}`);
  },
  /**
   * @description: 修改生长记录管理
   * @param {Object}  *
   */
  editlist(params) {
    return axios.post('/v3/growth/growthProcessRecord/edit', params);
  },
  /**
   * @description: 修改生长记录虫害
   * @param {Object}  *
   */
  editpestlist(params) {
    return axios.post('/growthProcessRecordPests/edit', params);
  },
  /**
   * @description: 条件查询批次
   * @param {Object}  *
   */
  getallbatchList(params) {
    return axios.post('/v3/batch/productionBatch/queryByCondition', {
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      organizationNo: sessionStorage.organizationNo,
      ...params
      // organizationNo: sessionStorage.getItem("organizationNo")
    });
  },
  /**
   * @description: 条件查询所有生长阶段
   * @param {Object}  *
   */
  getallgrowthPhasList(params) {
    return axios.post('/v3/templateTenant/growthPhase/queryByCondition', {
      ...params,
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      organizationNo: sessionStorage.getItem("organizationNo")
    });
  },
  /**
   * @description: 条件查询所有生长阶段
   * @param {Object}  *
   */
  getByBatchNoPhasList(params) {
    return axios.get(`/v3/growth/growthSeedAnalysis/queryGrowthPhaseListByBatchNo?batchNo=${params}`);
  },
  /**
   * @description: 按时间查询最近数据项
   * @param {Object}  *
   */
  getalldataitembydateList(params) {
    return axios.post('v3/iot/dataItem/queryLastDataByFacilityNo', {
      ...params
    });
  },
  /**
   * @description: 通过图片id查图片
   * @param {Object}  *
   */
  getpicmessage(picid) {
    return axios.post(`rowthProcessPicture/query/${picid}`);
  }
};
